package com.thor.palmmall.dao.common;

import java.text.DecimalFormat;

import org.apache.commons.lang3.time.FastDateFormat;

/**
 * 常用日期、数字格式。
 * 
 * @author Debenson
 * @since 0.1
 */
public class Format {

  /** 日期格式：年月日 */
  public static final String yMd = "yyyy-M-d";
  public static final FastDateFormat fmt_yMd = FastDateFormat.getInstance(yMd);

  /** 时间格式：时分 */
  public static final String Hm = "HH:mm";
  public static final FastDateFormat fmt_Hm = FastDateFormat.getInstance(Hm);

  /** 时间格式：时分秒 */
  public static final String Hms = Hm + ":ss";
  public static final FastDateFormat fmt_Hms = FastDateFormat.getInstance(Hms);
  /** 时间格式：时分秒+毫秒 */
  public static final String HmsS = Hms + ".SSS";
  public static final FastDateFormat fmt_HmsS = FastDateFormat.getInstance(HmsS);
  /** 日期格式：年月日+时分 */
  public static final String yMdHm = yMd + " " + Hm;
  public static final FastDateFormat fmt_yMdHm = FastDateFormat.getInstance(yMdHm);
  /** 日期格式：年月日+时分秒 */
  public static final String yMdHms = yMd + " " + Hms;
  public static final FastDateFormat fmt_yMdHms = FastDateFormat.getInstance(yMdHms);
  /** 日期格式：年月日+时分秒+毫秒 */
  public static final String yMdHmsS = yMd + " " + HmsS;
  public static final FastDateFormat fmt_yMdHmsS = FastDateFormat.getInstance(yMdHmsS);

  /** 数值格式：计数 */
  public static final String count = "0";
  public static final DecimalFormat fmt_count = new DecimalFormat(count);
  /** 数值格式：数量 */
  public static final String qty = ",##0.###";
  public static final DecimalFormat fmt_qty = new DecimalFormat(qty);
  /** 数值格式：金额 */
  public static final String money = ",##0.00";
  public static final DecimalFormat fmt_money = new DecimalFormat(money);
  /** 数值格式：单价 */
  public static final String price = ",##0.00";
  public static final DecimalFormat fmt_price = new DecimalFormat(price);
  /** 数值格式：箱数 */
  public static final String caseCount = "0.0";
  public static final DecimalFormat fmt_caseCount = new DecimalFormat(caseCount);
  /** 数值格式：比率 */
  public static final String rate = "0.####";
  public static final DecimalFormat fmt_rate = new DecimalFormat(rate);
  /** 数值格式：百分比 */
  public static final String percent = "0.##%";
  public static final DecimalFormat fmt_percent = new DecimalFormat(percent);

}
